Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Viewer: enable pasting json report on app #1128

Merged
merged 2 commits into from
Dec 9, 2016
Merged

Viewer: enable pasting json report on app #1128

merged 2 commits into from
Dec 9, 2016

Conversation

ebidel
Copy link
Contributor

@ebidel ebidel commented Dec 8, 2016

R: all

So easy!

@ebidel ebidel added the viewer label Dec 8, 2016
Copy link
Member

@brendankenny brendankenny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

needs a rebase

const json = JSON.parse(e.clipboardData.getData('text'));
this.replaceReportHTML(json);
} catch (err) {
// noop
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe log the failure here?

Copy link
Contributor Author

@ebidel ebidel Dec 9, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure it will be that useful to users. I'd prefer just ignoring random key pressing or users that accidentally paste something they didn't mean to in our app.

Note: replaceReportHTML will show a butter bar if the json file is invalid, so there's some feedback already built in if this go wrong.

onPaste(e) {
e.preventDefault();

ga('send', 'event', 'report', 'paste');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this be logging if it was an unsuccessful (e.g. inadvertent) paste?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@ebidel
Copy link
Contributor Author

ebidel commented Dec 9, 2016

PTAL

@ebidel
Copy link
Contributor Author

ebidel commented Dec 9, 2016

ping

Copy link
Member

@brendankenny brendankenny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM :paste:

@brendankenny brendankenny merged commit cfe647d into master Dec 9, 2016
@brendankenny brendankenny deleted the paste branch December 9, 2016 22:59
andrewrota pushed a commit to andrewrota/lighthouse that referenced this pull request Jan 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants